﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Payments.ascx.cs" Inherits="Hotel.UserControls.Payments" %>


<asp:GridView ID="gvpayment" runat="server" CellPadding="0" CellSpacing="0" HeaderStyle-BackColor="#EAEAEA"
    AutoGenerateColumns="false" CssClass="grid" AlternatingRowStyle-CssClass="gridAltRow"
    RowStyle-CssClass="gridRow" ShowFooter="True" EditRowStyle-CssClass="gridEditRow"
    FooterStyle-CssClass="gridFooterRow" OnRowCancelingEdit="gvpayment_RowCancelingEdit"
    OnRowCommand="gvpayment_RowCommand" OnRowDeleting="gvpayment_RowDeleting" OnRowUpdating="gvpayment_RowUpdating"
    DataKeyNames="PaymentModeId" OnRowEditing="gvpayment_RowEditing" >
    <Columns>
        <asp:TemplateField HeaderText="Payment Mode" HeaderStyle-HorizontalAlign="Left">
            <ItemTemplate>
                <asp:Label ID="lblName" runat="server" Text='<%# Eval("PaymentMode") %>' Width="150"></asp:Label>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("PaymentMode") %>' CssClass="textbox"
                    Width="150"></asp:TextBox>
                 <asp:RequiredFieldValidator ID="txtNameIRq" runat="server" ErrorMessage="Payment Mode is Required"
                    SetFocusOnError="true"
                    ControlToValidate="txtName" ValidationGroup="Edit" Display="None"></asp:RequiredFieldValidator>
            </EditItemTemplate>
            <FooterTemplate>
                <asp:TextBox ID="txtNameNew" runat="server" CssClass="textbox" Width="150"></asp:TextBox>
                   <asp:RequiredFieldValidator ID="txtNameIRq" runat="server" ErrorMessage="Payment Mode is Required"
                    SetFocusOnError="true"
                    ControlToValidate="txtNameNew" ValidationGroup="Insert" Display="None"></asp:RequiredFieldValidator>
            </FooterTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Surcharge Percent" HeaderStyle-HorizontalAlign="Left">
            <ItemTemplate>
                <asp:Label ID="lblSurchargePercent" runat="server" Text='<%# Eval("SurchargePercent") %>'
                    Width="50"></asp:Label>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:TextBox ID="txtSurchargePercent" runat="server" Text='<%# Bind("SurchargePercent") %>'
                    CssClass="textbox"
                    Width="50"></asp:TextBox>
            </EditItemTemplate>
            <FooterTemplate>
                <asp:TextBox ID="txtSurchargePercent" runat="server" CssClass="textbox" Width="50"></asp:TextBox>
            </FooterTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Edit" ShowHeader="False" HeaderStyle-HorizontalAlign="Left">
            <EditItemTemplate>
                <asp:LinkButton ID="lnkUpdate" runat="server" CausesValidation="True" CommandName="Update"
                    Text="Update" OnClientClick="return confirm('Update?')" ValidationGroup="Update"></asp:LinkButton>
                <asp:ValidationSummary ID="vsUpdate" runat="server" ShowMessageBox="true" ShowSummary="false"
                    ValidationGroup="Update" Enabled="true" HeaderText="Validation Summary..." />
                <asp:LinkButton ID="lnkCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="Cancel"></asp:LinkButton>
            </EditItemTemplate>
            <FooterTemplate>
                <asp:LinkButton ID="lnkAdd" runat="server" CausesValidation="True" CommandName="Insert"
                    ValidationGroup="Insert" Text="Insert"></asp:LinkButton>
                <asp:ValidationSummary ID="vsInsert" runat="server" ShowMessageBox="true" ShowSummary="false"
                    ValidationGroup="Insert" Enabled="true" HeaderText="Validation..." />
            </FooterTemplate>
            <ItemTemplate>
                <asp:LinkButton ID="lnkEdit" runat="server" CausesValidation="False" CommandName="Edit"
                    Text="Edit"></asp:LinkButton>
            </ItemTemplate>
            <HeaderStyle HorizontalAlign="Left" />
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Delete" ShowHeader="False" HeaderStyle-HorizontalAlign="Left"
            Visible="false">
            <ItemTemplate>
                <asp:LinkButton ID="lnkDelete" runat="server" CausesValidation="False" CommandName="Delete"
                    Text="Delete" OnClientClick="return confirm('Delete?')"></asp:LinkButton>
            </ItemTemplate>
            <HeaderStyle HorizontalAlign="Left" />
        </asp:TemplateField>
    </Columns>
    <EmptyDataTemplate>
        <table class="grid" cellspacing="0" rules="all" border="1" id="Table1" style="border-collapse: collapse;">
							<tr>
								<th align="left" scope="col">
									PaymentMode
								</th>
                               <th align="left" scope="col"> SurchargePercent</th>
								<th align="left" scope="col">
									Edit
								</th>
								<th scope="col">
									Delete
								</th>
							</tr>
							<tr class="gridRow">
								<td colspan="3">
									No Records found...
								</td>
							</tr>
    </EmptyDataTemplate>
</asp:GridView>

